Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix libdns::Record to dnsmadeeasy::Record translation #4

Merged
merged 3 commits into from
Oct 14, 2024

Conversation

coandco
Copy link
Collaborator

@coandco coandco commented Sep 5, 2024

I'm not sure when DNSMadeEasy tweaked their API, but there are now several incompatibilities with the module as it exists. Specifically:

  1. The CreateRecords call now returns the value of the created record wrapped in spurious/non-existent quotes (see CreateRecords problem #3). This removes them.
  2. DNSMadeEasy no longer accepts a TTL of 0 (which certmagic passes us by default unless it's set specifically), so dmeRecordFromRecord will now set a default value of 120 if the value is 0.
  3. Similarly, they require a value to be set for GtdLocation from the possible values DEFAULT, US_EAST, US_WEST, EUROPE, ASIA_PAC, OCREANIA, SOUTH_AMERICA. We set it to DEFAULT.
  4. Finally, if we get passed a blank string for record.ID, we translate it to 0 in the dmeRecord struct, so it will properly be omitted thanks to the json:"id,omitempty" tag on the dmeRecord.ID item.

@coandco
Copy link
Collaborator Author

coandco commented Sep 5, 2024

I've verified that this works alongside my parallel pull request John-K/dnsmadeeasy#4 by running the following xcaddy command:

xcaddy build --with github.com/caddy-dns/dnsmadeeasy --with github.com/libdns/dnsmadeeasy=github.com/coandco/[email protected] --with github.com/john-k/dnsmadeeasy=github.com/coandco/[email protected]

The resulting binary successfully obtains certs using the DNS01 challenge on DNSMadeEasy.

@coandco coandco merged commit 6e8a0fe into libdns:main Oct 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant